<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="taglib" prefix="pln" %>

<h3><i class="gen-enclosed foundicon-tools"></i>Grilla de Pagina</h3>
<p class="note">Selecciona un tipo de grilla para tu pagina.</p>     

<span id="pageInfo" data-pageId="${page.id}" data-pageType="${page.pageType}"></span>
<div id="page_templates" class="layout-selector">
       <ul>
        	<c:forEach  items="${config.archiveTemplates}" var="template" varStatus="status">
        		<li id="template-${template}" data-template="${template}" class="${page.template eq template ? 'active' : ''}">
            		<img src="${pageContext.request.contextPath}/images/structure/${template}.jpg">
           			<input name="layout" type="radio" value="layout-${template}" ${page.template eq template ? 'checked' : ''} />
            	</li>
			</c:forEach>               
     	
       </ul>
                            
</div> 



<h3><i class="gen-enclosed foundicon-tools"></i>Entradas al archivo</h3>
<p class="note">Cada entrada tiene titulo + texto + imagen o video.</p> 


<div class="form-actions">
    <button id="create_new_post" type="submit" class="btn">Crear una nueva entrada</button>
</div>


<!-- //////// esta seria el <section class="upload_post">, solo apareceria cuando apretas el boton "crear una nueva entrada" que esta arriba //////// -->

<section class="upload_post" id="upload_post" style="display:none">
<form id='imageForm_archive1' data-formtype='archiveForm'>
<input class="form-control archiveForm"  id="id" name="id" type="hidden" value=""/>
<input class="form-control archiveForm" id="title" name="title" type="text" placeholder="Titulo1" />
 <!-- hay que agregarle el rich text editor -->
<textarea class="form-control archiveForm" id="archive_text" name="text"  placeholder="Texto 1"></textarea>
<input class="form-control archiveForm" id="tags" name="tags" type="text" placeholder="tags separados por , Ej: noticias, buenos aires, hoteles" />
<input class="form-control archiveForm" id="video_url" name="video_url" type="text" placeholder="url de video" />

</form>
<div id='imageContainer_archive1'>
<div class="actions upload">
<button class='uploder_button btn btn-default' id="archive_ub">SUBIR IMAGEN</button>
<input class='fileupload' type='file' name='files[]' data-url='controller/upload.htm' data-uploaderid='archive1'>
<div id='dropzone_archive1' class='dropzone'>Drop files here</div>
<div id='error_msj_archive1' class='errror_msj'></div>
<div id='progress_archive1' class='progress progress_bar'>
<div class='bar' style='width: 0%;'></div>
</div>
<div id='uploaded-files_archive1' class='uploaded_file' data-key='archive' data-type='gallery'></div>

</div>
</div>
<button class='btn btn-primary sendCrop' data-uploaderid='archive1'>Agregar</button>
</section>

<!-- //////// fin de el bloque de entrada" //////// -->


<table id='archive_table_archive1' width='100%' border='0' cellspacing='0' cellpadding='0' class='table table-striped'>
<c:forEach  items="${page.archives}" var="archive" varStatus="status">
<tr id='archive_${archive.id}'>
<td><img class='gallery_image' src='/userimages/${website.id}/${archive.image.fileName}'></td>
<td class='text'>${archive.title}</td>
<td class='icon'><button class='btn info alternative icon archive edit' data-uploaderid='archive1' data-itemId='${archive.id}'></button></td>
<td class='icon'><button class='btn danger alternative icon archive remove' data-uploaderid='archive1' data-itemId='${archive.id}'></button></td>
<td class='icon'><div class='editImage'><span><img class='archive_up' src='css/images/arrow-up.png'/><img class='archive_down' src='css/images/arrow-down.png'/></span></div></td>
</tr>
</c:forEach>                 
</table>

<div class='modal fade' id='modal_archive' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-body'>
<h4>Desea borrar archive?</h4>
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-default' data-dismiss='modal'>Cancelar</button>
<button type='button' class='btn btn-danger' data-dismiss='modal' id='archiveRemove'>Borrar</button>
</div>
</div>
</div>
</div>
